<template>
	<view class="orderListBox">
		<view>
			<!-- 轮播图 -->
			<swiper class="swiperImgBox" circular indicator-dots="true" autoplay="true" interval="3000" duration="1000">
				<swiper-item>
					<image class="swiperImgBox" src="@/static/images/banner.png" mode=""></image>
				</swiper-item>
			</swiper>

			<!-- 一级tab -->
			<view class="MainTab">
				<view v-for="item in MainTabList" :key="item.value"
					:class="mainTabIndex==item.value?'zhuCrtStyle':'zhucar'" @click="oneTabEvent(item)">
					<text> {{item.label}}</text>
				</view>
			</view>

			<!-- 二级tab  -->
			<!-- 新订单 -------------------------------------- -->
			<view class="towTabBox twoTab_new" v-if="mainTabIndex==1">
				<view style="display: flex;">
					<view class="twoTabStyle" v-for="item in newList" :key="item.value"
						:class="newIndex==item.value?'newCrtStyle':''" @click="twoTabEvent(item)">
						<text> {{item.label}}</text>
						<text>({{item.num}})</text>
						<text></text>
					</view>
				</view>
				<!-- 待核价列表 -->
				<scroll-view v-if="newIndex==1" class="sh" scroll-y="true" :refresher-enabled="true"
					:refresher-triggered="refresher" :refresher-threshold="100" refresher-background="#258258"
					@refresherrefresh="onRefresh" @scrolltolower="onscrolltolower">
					<view v-for="(item,index) in orderListData" :key="index">
						<view class="cardStyle" v-if="newIndex==1" @click.prevent="EnterDetails(item,1)">
							<image class="borderStyle" src="@/static/images/半圆.png" mode=""></image>
							<view style="font-size: 34rpx;font-weight: bold; margin-bottom: 30rpx;">
								{{item.addres||'--'}}
							</view>
							<view class="cardItemStyle">
								创建时间： {{timestampToTime_M(item.create_time)||'--'}}
							</view>
							<view class="cardItemStyle" @click.stop="callup(item.mobile)">
								<view>
									<text>益鸟店长：{{item.username||'--'}}</text>
									<text
										style="color: #179332;text-decoration:underline; ">{{item.mobile||'--'}}</text>
								</view>
								<image style="width: 40rpx;height: 40rpx;" src="../../static/images/电话.png" mode="">
								</image>
							</view>
							<view class="cardItemStyle" @click.stop="callup(item.admin_mobile)">
								<view>
									<text>益鸟设计师：{{item.admin_name||'--'}}</text>
									<text
										style="color: #179332;text-decoration:underline;">{{item.admin_mobile||'--'}}</text>
								</view>
								<image style="width: 40rpx;height: 40rpx;" src="../../static/images/电话.png" mode="">
								</image>
							</view>
							<view class="cardItemStyle">
								产品清单：共计{{item.num||'--'}}项
							</view>
							<view style="color: #d43f46;font-size: 24rpx;" v-if="item.rejection_reason">
								<view>被供应链驳回，需要你根据驳回原因再次操作!</view>
								<view>驳回原因：{{item.rejection_reason}}</view>
							</view>
							<view style="width: 100%;display: flex;justify-content: flex-end;">
								<view class="confirm">
									核价确认
								</view>
							</view>
						</view>
					</view>
					<view v-if="orderListData.length>0&&isLoadMore" class="flex_center" style="color: #666;">没有更多了~
					</view>
				</scroll-view>
				<!-- 待益鸟确认价格列表 -->
				<scroll-view v-if="newIndex==2" class="sh" scroll-y="true" :refresher-enabled="true"
					:refresher-triggered="refresher" :refresher-threshold="100" refresher-background="#258258"
					@refresherrefresh="onRefresh" @scrolltolower="onscrolltolower">
					<view v-for="(item,index) in orderListData" :key="index">
						<view class="cardStyle" v-if="newIndex==2" @click.prevent="EnterDetails(item,2)">
							<image class="borderStyle" src="@/static/images/半圆.png" mode=""></image>
							<view style="font-size: 34rpx;font-weight: bold; margin-bottom: 30rpx;">
								{{item.addres||'--'}}
							</view>
							<view class="cardItemStyle">
								创建时间： {{timestampToTime_M(item.create_time)||'--'}}
							</view>
							<view class="cardItemStyle" @click.stop="callup(item.mobile)">
								<view>
									<text>益鸟店长：{{item.username||'--'}}</text>
									<text
										style="color: #179332;text-decoration:underline; ">{{item.mobile||'--'}}</text>
								</view>
								<image style="width: 40rpx;height: 40rpx;" src="../../static/images/电话.png" mode="">
								</image>
							</view>
							<view class="cardItemStyle" @click.stop="callup(item.admin_mobile)">
								<view>
									<text>益鸟设计师：{{item.admin_name||'--'}}</text>
									<text
										style="color: #179332;text-decoration:underline;">{{item.admin_mobile||'--'}}</text>
								</view>
								<image style="width: 40rpx;height: 40rpx;" src="../../static/images/电话.png" mode="">
								</image>
							</view>
							<view class="cardItemStyle">
								产品清单：共计{{item.num||'--'}}项
							</view>
							<view style="color: #d43f46;font-size: 24rpx;" v-if="item.rejection_reason">
								<view>被供应链驳回，需要你根据驳回原因再次操作!</view>
								<view>驳回原因：{{item.rejection_reason}}</view>
							</view>
							<view style="font-size: 26rpx;color: #179332;margin-top: 40rpx;">
								{{`您在${timestampToTime_M(item.agency_confirm_time)}已完成确认，待益鸟确认中`}}
							</view>
						</view>
					</view>
					<view v-if="orderListData.length>0&&isLoadMore" class="flex_center" style="color: #666;">没有更多了~
					</view>
				</scroll-view>
			</view>

			<!-- 生产及配送 -------------------------------------->
			<view class="towTabBox twoTab_produce" v-if="mainTabIndex==2">
				<view style="display: flex;">
					<view class="twoTabStyle" v-for="item in produceList" :key="item.value"
						:class="produceIndex==item.value?'newCrtStyle':''" @click="twoTabEvent(item)">
						<text> {{item.label}}</text>
						<text>({{item.num}})</text>
					</view>
				</view>
				<!--待生产 -->
				<scroll-view v-if="produceIndex==1" class="sh" scroll-y="true" :refresher-enabled="true"
					:refresher-triggered="refresher" :refresher-threshold="100" refresher-background="#258258"
					@refresherrefresh="onRefresh" @scrolltolower="onscrolltolower">
					<view v-for="(item,index) in orderListData" :key="index">
						<view class="cardStyle" v-if="produceIndex==1" @click.prevent="EnterDetails(item,3)">
							<image class="borderStyle" src="@/static/images/半圆.png" mode=""></image>
							<view style="font-size: 34rpx;font-weight: bold;">
								{{item.addres||'--'}}
							</view>
							<view class="cardItemStyle">
								创建时间： {{timestampToTime_M(item.create_time)||'--'}}
							</view>
							<view class="cardItemStyle" @click.stop="callup(item.mobile)">
								<view>
									<text>益鸟店长：{{item.username||'--'}}</text>
									<text
										style="color: #179332;text-decoration:underline; ">{{item.mobile||'--'}}</text>
								</view>
								<image style="width: 40rpx;height: 40rpx;" src="../../static/images/电话.png" mode="">
								</image>
							</view>
							<view class="cardItemStyle" @click.stop="callup(item.admin_mobile)">
								<view>
									<text>益鸟设计师：{{item.admin_name||'--'}}</text>
									<text
										style="color: #179332;text-decoration:underline;">{{item.admin_mobile||'--'}}</text>
								</view>
								<image style="width: 40rpx;height: 40rpx;" src="../../static/images/电话.png" mode="">
								</image>
							</view>
							<view class="cardItemStyle">
								产品清单：共计{{item.num||'--'}}项
							</view>
							<view
								style="display: flex;justify-content: space-between;align-items: center;margin-top: 40rpx;">
								<view style="font-size: 26rpx;color: #179332;">
									{{`益鸟${timestampToTime_M(item.designer_confirm_time)}确认完成`}}
								</view>
								<view class="confirm">
									确认生产
								</view>
							</view>
						</view>
					</view>
					<view v-if="orderListData.length>0&&isLoadMore" class="flex_center" style="color: #666;">没有更多了~
					</view>
				</scroll-view>
				<!--生产中 -->
				<scroll-view v-if="produceIndex==2" class="sh" scroll-y="true" :refresher-enabled="true"
					:refresher-triggered="refresher" :refresher-threshold="100" refresher-background="#258258"
					@refresherrefresh="onRefresh" @scrolltolower="onscrolltolower">
					<view v-for="(item,index) in orderListData" :key="index">
						<view class="cardStyle" v-if="produceIndex==2" @click.prevent="EnterDetails(item,4)">
							<image class="borderStyle" src="@/static/images/半圆.png" mode=""></image>
							<view style="font-size: 34rpx;font-weight: bold;">
								{{item.addres||'--'}}
							</view>
							<view class="cardItemStyle">
								创建时间： {{timestampToTime_M(item.create_time)||'--'}}
							</view>
							<view style="margin: 10rpx 0;">
								<uni-tag :inverted="true" :text="item.first_payment_confirm_time? '首款结算完成':'首款结算中'"
									:type="item.first_payment_confirm_time?'success':'warning'" />
							</view>
							<view class="cardItemStyle" @click.stop="callup(item.mobile)">
								<view>
									<text>益鸟店长：{{item.username||'--'}}</text>
									<text
										style="color: #179332;text-decoration:underline; ">{{item.mobile||'--'}}</text>
								</view>
								<image style="width: 40rpx;height: 40rpx;" src="../../static/images/电话.png" mode="">
								</image>
							</view>
							<view class="cardItemStyle" @click.stop="callup(item.admin_mobile)">
								<view>
									<text>益鸟设计师：{{item.admin_name||'--'}}</text>
									<text
										style="color: #179332;text-decoration:underline;">{{item.admin_mobile||'--'}}</text>
								</view>
								<image style="width: 40rpx;height: 40rpx;" src="../../static/images/电话.png" mode="">
								</image>
							</view>
							<view class="cardItemStyle">
								产品清单：共计{{item.num||'--'}}项
							</view>
							<view
								style="display: flex;justify-content: space-between;align-items: center;margin-top: 40rpx;">
								<view style="font-size: 26rpx;color: #179332;">
									{{`约定${timestampToTime_D(item.generation_completion_time)}可配送`}}
								</view>
								<view class="confirm">
									生产完成可配送
								</view>
							</view>
						</view>
					</view>
					<view v-if="orderListData.length>0&&isLoadMore" class="flex_center" style="color: #666;">没有更多了~
					</view>
				</scroll-view>
				<!--待配送 -->
				<scroll-view v-if="produceIndex==3" class="sh" scroll-y="true" :refresher-enabled="true"
					:refresher-triggered="refresher" :refresher-threshold="100" refresher-background="#258258"
					@refresherrefresh="onRefresh" @scrolltolower="onscrolltolower">
					<view v-for="(item,index) in orderListData" :key="index">
						<view class="cardStyle" v-if="produceIndex==3" @click.prevent="EnterDetails(item,5)">
							<image class="borderStyle" src="@/static/images/半圆.png" mode=""></image>
							<view style="font-size: 34rpx;font-weight: bold; ">
								{{item.addres||'--'}}
							</view>
							<view class="cardItemStyle">
								创建时间： {{timestampToTime_M(item.create_time)||'--'}}
							</view>
							<view style="margin: 10rpx 0;">
								<uni-tag :inverted="true" :text="item.first_payment_confirm_time? '首款结算完成':'首款结算中'"
									:type="item.first_payment_confirm_time?'success':'warning'" />
							</view>
							<view class="cardItemStyle" @click.stop="callup(item.mobile)">
								<view>
									<text>益鸟店长：{{item.username||'--'}}</text>
									<text
										style="color: #179332;text-decoration:underline; ">{{item.mobile||'--'}}</text>
								</view>
								<image style="width: 40rpx;height: 40rpx;" src="../../static/images/电话.png" mode="">
								</image>
							</view>
							<view class="cardItemStyle" @click.stop="callup(item.admin_mobile)">
								<view>
									<text>益鸟设计师：{{item.admin_name||'--'}}</text>
									<text
										style="color: #179332;text-decoration:underline;">{{item.admin_mobile||'--'}}</text>
								</view>
								<image style="width: 40rpx;height: 40rpx;" src="../../static/images/电话.png" mode="">
								</image>
							</view>
							<view class="cardItemStyle">
								产品清单：共计{{item.num||'--'}}项
							</view>
							<view
								style="display: flex;justify-content: space-between;align-items: center;margin-top: 40rpx;">
								<view style="font-size: 26rpx;color: #179332;">
									{{`约定${timestampToTime_D(item.deliverable_time)}可配送`}}
								</view>
								<view class="confirm">
									配送完成
								</view>
							</view>
						</view>

					</view>
					<view v-if="orderListData.length>0&&isLoadMore" class="flex_center" style="color: #666;">没有更多了~
					</view>
				</scroll-view>
			</view>

			<!-- 已完成 --------------------------------------- -->
			<view class="towTabBox twoTab_done" v-if="mainTabIndex==3">
				<view style="display: flex;">
					<view class="twoTabStyle" v-for="item in doneList" :key="item.value"
						:class="doneIndex==item.value?'newCrtStyle':''" @click="twoTabEvent(item)">
						<text> {{item.label}}</text>
						<text>({{item.num}})</text>
					</view>
				</view>
				<scroll-view v-if="doneIndex==1" class="sh" scroll-y="true" :refresher-enabled="true"
					:refresher-triggered="refresher" :refresher-threshold="100" refresher-background="#258258"
					@refresherrefresh="onRefresh" @scrolltolower="onscrolltolower">
					<!-- 结算中 -->
					<view v-for="(item,index) in orderListData" :key="index">
						<view class="cardStyle" v-if="doneIndex==1" @click.prevent="EnterDetails(item,6)">
							<image class="borderStyle" src="@/static/images/半圆.png" mode=""></image>
							<view style="font-size: 34rpx;font-weight: bold;">
								{{item.addres||'--'}}
							</view>

							<view class="cardItemStyle">
								创建时间： {{timestampToTime_M(item.create_time)||'--'}}
							</view>
							<view style="margin: 10rpx 0;">
								<uni-tag :inverted="true" :text="item.first_payment_confirm_time? '首款结算完成':'首款结算中'"
									:type="item.first_payment_confirm_time?'success':'warning'" />
								<uni-tag :inverted="true" :text="item.last_payment_confirm_time? '尾款结算完成':'尾款结算中'"
									:type="item.last_payment_confirm_time?'success':'warning'"
									style="margin-left: 15rpx;" />
							</view>
							<view class="cardItemStyle" @click.stop="callup(item.mobile)">
								<view>
									<text>益鸟店长：{{item.username||'--'}}</text>
									<text
										style="color: #179332;text-decoration:underline; ">{{item.mobile||'--'}}</text>
								</view>
								<image style="width: 40rpx;height: 40rpx;" src="../../static/images/电话.png" mode="">
								</image>
							</view>
							<view class="cardItemStyle" @click.stop="callup(item.admin_mobile)">
								<view>
									<text>益鸟设计师：{{item.admin_name||'--'}}</text>
									<text
										style="color: #179332;text-decoration:underline;">{{item.admin_mobile||'--'}}</text>
								</view>
								<image style="width: 40rpx;height: 40rpx;" src="../../static/images/电话.png" mode="">
								</image>
							</view>
							<view class="cardItemStyle">
								产品清单：共计{{item.num||'--'}}项
							</view>
							<view v-if="!item.send_msg_time" style="width: 100%;display: flex;justify-content: end;">
								<view class="confirm">
									催单验收
								</view>
							</view>
						</view>
					</view>
					<view v-if="orderListData.length>0&&isLoadMore" class="flex_center" style="color: #666;">没有更多了~
					</view>
				</scroll-view>
				<!-- 结算完成 -->
				<scroll-view v-if="doneIndex==2" class="sh" scroll-y="true" :refresher-enabled="true"
					:refresher-triggered="refresher" :refresher-threshold="100" refresher-background="#258258"
					@refresherrefresh="onRefresh" @scrolltolower="onscrolltolower">
					<view v-for="(item,index) in orderListData" :key="index">
						<view class="cardStyle" v-if="doneIndex==2" @click.prevent="EnterDetails(item,7)">
							<image class="borderStyle" src="@/static/images/半圆.png" mode=""></image>
							<view style="font-size: 34rpx;font-weight: bold;">
								{{item.addres||'--'}}
							</view>
							<view class="cardItemStyle">
								创建时间： {{timestampToTime_M(item.create_time)||'--'}}
							</view>
							<view style="margin: 10rpx 0;">
								<uni-tag :inverted="true" :text="item.first_payment_confirm_time? '首款结算完成':'首款结算中'"
									:type="item.first_payment_confirm_time?'success':'warning'" />
								<uni-tag :inverted="true" :text="item.last_payment_confirm_time? '尾款结算完成':'尾款结算中'"
									:type="item.last_payment_confirm_time?'success':'warning'"
									style="margin-left: 15rpx;" />
							</view>
							<view class="cardItemStyle" @click.stop="callup(item.mobile)">
								<view>
									<text>益鸟店长：{{item.username||'--'}}</text>
									<text
										style="color: #179332;text-decoration:underline; ">{{item.mobile||'--'}}</text>
								</view>
								<image style="width: 40rpx;height: 40rpx;" src="../../static/images/电话.png" mode="">
								</image>
							</view>
							<view class="cardItemStyle" @click.stop="callup(item.admin_mobile)">
								<view>
									<text>益鸟设计师：{{item.admin_name||'--'}}</text>
									<text
										style="color: #179332;text-decoration:underline;">{{item.admin_mobile||'--'}}</text>
								</view>
								<image style="width: 40rpx;height: 40rpx;" src="../../static/images/电话.png" mode="">
								</image>
							</view>
							<view class="cardItemStyle">
								产品清单：共计{{item.num||'--'}}项
							</view>
							<view
								style="display: flex;justify-content: space-between;align-items: center;margin-top: 40rpx;">
								<view style="font-size: 26rpx;color: #179332;">
									{{`结算时间：${timestampToTime_S(item.last_payment_confirm_time)}`}}
								</view>
								<view class="confirm">
									查看结算详情
								</view>
							</view>
						</view>
					</view>
					<view v-if="orderListData.length>0&&isLoadMore" class="flex_center" style="color: #666;">没有更多了~
					</view>
				</scroll-view>
			</view>

			<!-- 列表暂无数据占位图 -->
			<view
				style="display: flex;flex-direction: column;align-items: center;position: absolute;top: 47%;left: 50%;transform: translate(-50%);"
				v-if="orderListData.length==0">
				<image src="@/static/images/noDatalist.png" mode=""
					style="margin: 30rpx 0;width: 400rpx;height: 400rpx;"></image>
				<view style="color: #999;">
					暂无数据
				</view>
			</view>

		</view>
	</view>
</template>

<script setup>
	import {
		onHide,
		onLaunch,
		onLoad,
		onShow,
	} from '@dcloudio/uni-app';

	import {
		ref
	} from 'vue';
	import {
		timestampToTime_M,
		timestampToTime_D,
		timestampToTime_S
	} from "@/utils/date.js"; // 引入工具函数时间格式转化
	import {
		SCM_scmList
	} from '@/api/api.js' //引入api接口

	const pageSize = ref(3)
	const pageNum = ref(1)
	const orderState = ref(1) //state = 1 进入当前页默认展示这个状态列表数据
	const userInfo = ref({}) //用户信息
	const agency_id = ref('') //供应商id
	const refresher = ref(false) //当前下拉刷新状态

	const isLoadMore = ref(false) //是否加载中
	const orderListData = ref([]) //供应商列表

	onLoad(() => {
		// #ifdef MP-WEIXIN
		// 开启小程序原生右上角分享按钮
		uni.showShareMenu({
			withShareTicket: true,
			menus: ['shareAppMessage', 'shareTimeline'] //开启转发好友和转发朋友圈按钮
		});
		// #endif
	})
	onShow(() => {
		userInfo.value = uni.getStorageSync('userInfo') && JSON.parse(uni.getStorageSync('userInfo'))
		agency_id.value = userInfo.value.agency_id
		orderListData.value = []
		pageNum.value = 1
		isLoadMore.value = false
		orderLists() //获取供应商列表  
	})
	// 获取供应商列表-------------
	const orderLists = async () => {
		let params = {
			page_size: pageSize.value,
			page_no: pageNum.value,
			agency_id: agency_id.value, //供应商id
			status: orderState.value, //订单状态 1.待核价 2.待益鸟确认价格 3.待生产 4.生产中 5.待配置送 6.结算中 7.结算完成'
		}
		const res = await SCM_scmList(params)
		console.log('获取供应商列表', res);
		if (res.code == 0) {
			orderListData.value = orderListData.value.concat(res.data.list)
			//判断接口返回数据量小于请求数据量，则表示此为最后一页
			if (res.data.list.length < pageSize.value) {
				isLoadMore.value = true
			} else {
				isLoadMore.value = false
			}
			// 每次请求列表把订单数量置空
			newList.value[0].num = 0
			newList.value[1].num = 0
			produceList.value[0].num = 0
			produceList.value[1].num = 0
			produceList.value[2].num = 0
			doneList.value[0].num = 0
			doneList.value[1].num = 0
			// 当前订单状态的总数量
			res.data.sub_num.forEach((ele) => {
				if (ele.status == 1) {
					newList.value[0].num = ele.num
				} else if (ele.status == 2) {
					newList.value[1].num = ele.num
				} else if (ele.status == 3) {
					produceList.value[0].num = ele.num
				} else if (ele.status == 4) {
					produceList.value[1].num = ele.num
				} else if (ele.status == 5) {
					produceList.value[2].num = ele.num
				} else if (ele.status == 6) {
					doneList.value[0].num = ele.num
				} else {
					doneList.value[1].num = ele.num
				}
			})

		} else {
			isLoadMore.value = true //是否加载中
		}
	}


	// 一级tab
	const MainTabList = ref([{
			label: "新订单",
			value: 1
		},
		{
			label: "生产及配送",
			value: 2
		},
		{
			label: "已完成",
			value: 3
		}
	])
	const mainTabIndex = ref(1)
	// 二级tab
	// 新订单
	const newList = ref([{
			label: "待核价",
			value: 1,
			Pid: 1,
			status: 1,
			num: 0
		},
		{
			label: "待益鸟确认价格",
			value: 2,
			Pid: 1,
			status: 2,
			num: 0
		}
	])
	const newIndex = ref(1)
	// 生产以及配送
	const produceList = ref([{
			label: "待生产",
			value: 1,
			Pid: 2,
			status: 3,
			num: 0
		},
		{
			label: "生产中",
			value: 2,
			Pid: 2,
			status: 4,
			num: 0
		},
		{
			label: "待配送",
			value: 3,
			Pid: 2,
			status: 5,
			num: 0
		}
	])
	const produceIndex = ref(1)
	// 已完成
	const doneList = ref([{
			label: "结算中",
			value: 1,
			Pid: 3,
			status: 6,
			num: 0
		},
		{
			label: "结算完成",
			value: 2,
			Pid: 3,
			status: 7,
			num: 0
		}
	])
	const doneIndex = ref(1)

	// 一级tab
	const oneTabEvent = (item) => {
		if (item.value == 1) {
			orderState.value = 1 //订单状态
		} else if (item.value == 2) {
			orderState.value = 3 //订单状态
		} else {
			orderState.value = 6 //订单状态
		}
		// 默认展示第一项
		mainTabIndex.value = item.value
		newIndex.value = 1
		produceIndex.value = 1
		doneIndex.value = 1
		pageNum.value = 1
		orderListData.value = []
		isLoadMore.value = false
		orderLists() //获取供应商列表
	}
	// 二级tab
	const twoTabEvent = (item) => {
		orderState.value = item.status //订单状态
		if (item.Pid == 1) {
			newIndex.value = item.value
		} else if (item.Pid == 2) {
			produceIndex.value = item.value
		} else {
			doneIndex.value = item.value
		}
		pageNum.value = 1
		orderListData.value = []
		isLoadMore.value = false
		orderLists() //获取供应商列表  
	}
	// 点击进入详情
	const EnterDetails = (orderItem, orderStatus) => {
		uni.navigateTo({
			url: '/pages/orderDetails/orderDetails?orderItem=' + JSON.stringify(orderItem) + '&orderStatus=' +
				orderStatus
		})
	}
	// 点击拨打电话
	const callup = (tel) => {
		if (tel) {
			uni.makePhoneCall({
				phoneNumber: tel //仅为示例
			});
		}
	}
	// 自定义下拉刷新被触发
	const onRefresh = () => {
		console.log('自定义下拉刷新被触发', );
		refresher.value = true
		setTimeout(() => {
			pageNum.value = 1
			orderListData.value = []
			isLoadMore.value = false
			orderLists() //获取供应商列表
			refresher.value = false
		}, 2000)
	}

	// 滚动到底部 上拉加载更多
	const onscrolltolower = () => {
		console.log("滚动到底部 上拉加载更多");
		if (!isLoadMore.value) { //此处进行判断上锁，防止重复请求
			isLoadMore.value = true
			pageNum.value += 1 //页数加1
			orderLists() //获取供应商列表  
		}

	}
</script>

<style lang="scss">
	.orderListBox {
		width: 100vw;

		.sh {
			margin: 10rpx 0;
			overflow-y: auto;
			height: 58vh; // 这是主要
			flex-grow: 1;
		}

		// 公共样式
		.zhuCrtStyle {
			font-size: 32rpx;
			font-family: Source Han Sans CN-Bold, Source Han Sans CN;
			font-weight: bold;
			color: #111;
			padding: 10rpx 0;
			border-bottom: 10rpx solid #007B46;

			view:nth-child(1) {
				margin-left: 20rpx;
			}
		}

		.zhucar {
			font-size: 32rpx;
		}

		.newCrtStyle {
			background: #007B46 !important;
			color: #FFF !important;
		}

		.towTabBox {
			margin: 10px 30rpx;
		}

		.swiperImgBox {
			width: 100%;
			height: 280rpx;
		}



		// 一级tab
		.MainTab {
			background: #FFF;
			padding: 30rpx;
			display: flex;
			align-items: center;
			font-size: 36rpx;
			font-family: Source Han Sans CN-Medium, Source Han Sans CN;
			color: #676767;

			view:nth-child(1) {
				margin-left: 20rpx;
			}

			view:nth-child(2) {
				margin: 0 60rpx;
			}
		}

		// 二级tab
		.twoTabStyle {
			background: #DFDFDF;
			border-radius: 40rpx;
			padding: 10rpx 20rpx;
			margin-right: 35rpx;
			font-size: 26rpx;
			font-family: Source Han Sans CN-Medium, Source Han Sans CN;
			font-weight: 500;
			color: #676767;
		}

		.cardStyle {
			position: relative;
			box-shadow: 0rpx 8rpx 8rpx 0rpx rgba(76, 99, 78, 0.2);
			border-radius: 40rpx;
			background: #FFF;
			margin: 25rpx 0;
			padding: 20rpx;

			.borderStyle {
				position: absolute;
				top: 0;
				left: 0;
				width: 40rpx;
				height: 40rpx;
			}

			.cardItemStyle {
				display: flex;
				justify-content: space-between;
				font-size: 28rpx;
				margin-bottom: 10rpx;
			}

			.confirm {
				display: flex;
				justify-content: center;
				align-items: center;
				padding: 10rpx 20rpx;
				background: #007B46;
				border-radius: 40rpx;
				font-family: Source Han Sans CN-Medium, Source Han Sans CN;
				font-weight: bold;
				font-size: 26rpx;
				color: #FFF;
			}
		}
	}
</style>